import request from '@/utils/request'

// 定义多个方法
const apiMethods = {
  path: '/upload',
  upload_file(formData) {
    return request({
      headers: { 'Content-Type': 'multipart/form-data' },
      url: this.path + '/file',
      method: 'post',
      data: formData
    })
  },
  chunk(formData) {
    return request({
      headers: { 'Content-Type': 'multipart/form-data' },
      url: this.path + '/chunk',
      method: 'post',
      data: formData
    })
  },
  upload_image(formData) {
    return request({
      headers: { 'Content-Type': 'multipart/form-data' },
      url: this.path + '/image',
      method: 'post',
      data: formData
    })
  },
}

export default apiMethods
